public class Utils {
		public static String formatDouble(double value, int decimals){
		String doubleStr = "" + value;
		int index = doubleStr.indexOf(".") != -1 ? doubleStr.indexOf("."): doubleStr.indexOf(",");
		// Decimal point can not be found...
		if (index == -1) return (String)doubleStr;
		// Truncate all decimals
		if (decimals == 0)
		return (String)doubleStr.substring(0, index);
		
		int len = index + decimals + 1;
		
		if (len >= doubleStr.length())
			len = doubleStr.length();
		double d = Double.parseDouble(doubleStr.substring(0, len));
		return (String)String.valueOf(d);
	}
}